import req from '@/utils/request'

/** ------------------------------1.添加分类------------------------------------ */
/**
 *
 * @param {String} cateName 分类名称
 * @param {Boolean} state 是否启用
 */
export function goodsAddCate(params) {
  return req.post('/goods/addcate', params)
}
/** ------------------------------2.获取商品列表------------------------------------ */
export function getGoodsList(params) {
  return req.get('/goods/list', params)
}
/** ------------------------------3.删除商品------------------------------------ */
export function delGoods(params) {
  return req.get('/goods/del', params)
}
/** ------------------------------4.修改商品------------------------------------ */
export function editGoods(params) {
  return req.post('/goods/edit', params)
}
/** ------------------------------5.添加商品------------------------------------ */
export function addGoods(params) {
  return req.post('/goods/add', params)
}
/** ------------------------------6.商品图片上传----------------------------------- */
export function goodsImgUpload(params) {
  return req.post('/goods/goods_img_upload', params)
}
/** ------------------------------7.获取商品分类----------------------------------- */
export function getGoodsCates(params) {
  return req.get('/goods/catelist', params)
}
/** ------------------------------8.添加商品分类----------------------------------- */
export function addGoodsCates(params) {
  return req.post('/goods/addcate', params)
}
/** ------------------------------9.修改商品分类----------------------------------- */
export function updateGoodsCates(params) {
  return req.post('/goods/editcate', params)
}
/** ------------------------------10.删除商品分类----------------------------------- */
export function delGoodsCates(params) {
  return req.get('/goods/delcate', params)
}
